import Android_QR_code_249 from '@/assets/img/h5/android_249.png';
import Android_QR_code_36 from '@/assets/img/h5/android_36.png';
import Android_QR_code from '@/assets/img/h5/android_QR_code.png';
import Iphone_QR_code from '@/assets/img/h5/iphone_QR_code.png';
import { useIntl } from '@umijs/max';
import React from 'react';
import Style from './index.less';

const hostname = window.location.hostname;

let android_qr = Android_QR_code;
if (hostname.includes('10.98.17.249')) {
  android_qr = Android_QR_code_249;
} else if (hostname.includes('120.25.246.36')) {
  android_qr = Android_QR_code_36;
}

const Footer: React.FC = () => {
  const intl = useIntl();
  const isEnglish = intl.locale === 'en-US';
  return (
    <div
      style={{
        marginBottom: 20,
      }}
    >
      <h3 className={`${Style.title} ${isEnglish ? Style.titleEn : ''}`}>
        {intl.formatMessage({ id: 'login.appDownload' })}
      </h3>
      <p className={Style.desc}>{intl.formatMessage({ id: 'login.account' })}</p>
      <div className={Style.qrCode}>
        <dl>
          <dt>
            <img src={android_qr} />
          </dt>
          <dd>Android&nbsp;{intl.formatMessage({ id: 'login.download' })}</dd>
        </dl>
        <dl>
          <dt>
            <img src={Iphone_QR_code} />
          </dt>
          <dd>iPhone&nbsp;{intl.formatMessage({ id: 'login.download' })}</dd>
        </dl>
      </div>
    </div>
  );
};
export default Footer;
